/*    */ package com.zimbra.cs.account.callback;
/*    */ 
/*    */ import com.google.common.collect.Maps;
/*    */ import com.google.common.collect.Sets;
/*    */ import com.zimbra.cs.account.AttributeCallback;
/*    */ import java.util.Map;
/*    */ import java.util.Set;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class CallbackContext
/*    */ {
/*    */   private final Op op;
/*    */   private String creatingEntryName;
/*    */   
/*    */   public static enum Op
/*    */   {
/* 30 */     CREATE, 
/* 31 */     MODIFY;
/*    */     
/*    */     private Op() {} }
/*    */   
/* 35 */   public static enum DataKey { MAX_SIGNATURE_LEN, 
/* 36 */     MAIL_FORWARDING_ADDRESS_MAX_LEN, 
/* 37 */     MAIL_FORWARDING_ADDRESS_MAX_NUM_ADDRS, 
/* 38 */     MAIL_WHITELIST_MAX_NUM_ENTRIES, 
/* 39 */     MAIL_BLACKLIST_MAX_NUM_ENTRIES;
/*    */     
/*    */ 
/*    */ 
/*    */ 
/*    */     private DataKey() {}
/*    */   }
/*    */   
/*    */ 
/*    */ 
/* 49 */   private Set<Class<? extends AttributeCallback>> done = Sets.newHashSet();
/*    */   
/*    */ 
/* 52 */   private Map<DataKey, String> dataMap = Maps.newHashMap();
/*    */   
/*    */   public CallbackContext(Op op) {
/* 55 */     this.op = op;
/*    */   }
/*    */   
/*    */   public boolean isCreate() {
/* 59 */     return this.op == Op.CREATE;
/*    */   }
/*    */   
/*    */   public void setCreatingEntryName(String name) {
/* 63 */     this.creatingEntryName = name;
/*    */   }
/*    */   
/*    */   public String getCreatingEntryName()
/*    */   {
/* 68 */     return this.creatingEntryName;
/*    */   }
/*    */   
/*    */   private void setDone(Class<? extends AttributeCallback> callback) {
/* 72 */     this.done.add(callback);
/*    */   }
/*    */   
/*    */   public boolean isDoneAndSetIfNot(Class<? extends AttributeCallback> callback) {
/* 76 */     boolean isDone = this.done.contains(callback);
/* 77 */     if (!isDone) {
/* 78 */       setDone(callback);
/*    */     }
/* 80 */     return isDone;
/*    */   }
/*    */   
/*    */   public void setData(DataKey key, String value) {
/* 84 */     this.dataMap.put(key, value);
/*    */   }
/*    */   
/*    */   public String getData(DataKey key) {
/* 88 */     return (String)this.dataMap.get(key);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/callback/CallbackContext.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */